package com.jsyl.lwbk.business.mq.receive;

/**
 * @author Fenny
 */
//@Component
public class ChildSignReceiver {

//    private static final Logger logger = LoggerFactory.getLogger(ChildSignReceiver.class);
//
//    @Autowired
//    private CourseChildMapper courseChildMapper;
//
//    @RabbitListener(queues = RabbitConfig.OTO_CHILD_SIGN_MQ)
//    @RabbitHandler
//    public void saveChild(@Payload String queue) {
//        logger.info("接收学生签到队列消息 ->", queue);
//
//        CourseChild courseChild = (CourseChild) JsonMapper.fromJsonString(queue, CourseChild.class);
//        CourseChild courseChildLocal = this.courseChildMapper.getByCourseIdChildId(courseChild.getCourseId(), courseChild.getChildId());
//        if (courseChildLocal == null) {
//            return;
//        }
//        try {
//            courseChildMapper.updateSignType(courseChildLocal.getCourseId(), courseChildLocal.getChildId(), courseChild.getSignType());
//
//        } catch (Exception e) {
//            logger.error("接收学生签到队列消息失败 ->{}", e.getMessage());
//        }
//    }

}
